package pro.softzhang.algo.lc2200;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class LC2215_FindTheDifferenceOfTwoArrays {
    public static void main(String[] args) {

    }

    static
    class Solution {
        public List<List<Integer>> findDifference(int[] nums1, int[] nums2) {
            Set<Integer> set1 = new HashSet<>(), set2 = new HashSet<>();
            for (int num : nums1) {
                set1.add(num);
            }
            for (int num : nums2) {
                set1.remove(num);
                set2.add(num);
            }
            for (int num : nums1) {
                set2.remove(num);
            }

            return new ArrayList<List<Integer>>(2){{
                add(new ArrayList<>(set1));
                add(new ArrayList<>(set2));
            }};
        }
    }
}
